<?php
include('rootlogin.php');
require('config.php');
if($_POST['new_pw']==$_POST['new_pw_check']){
	$user_con = mysql_connect($db_host,$db_user,$db_pass);
	mysql_select_db($db_name,$con);
$id = $_COOKIE['session_id'];
$old_pw = $_POST['old_pw'];
$new_pw = $_POST['new_pw'];
	$query = "UPDATE susers set password = password('$new_pw') WHERE guid = '$id' AND password = password('$old_pw')";
	$result = mysql_query($query,$con);

}
?>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Change Password</title>
<link rel="stylesheet" href="framestyle.css" type="text/css" media="screen">
<div id="wrapper">
<div id="title">Online Listening Comprehension Program</div>

<div id="main">

<hr/>
<div id="title2">修改密碼<font size=4></font></div>
<hr/>
<br><br>
<form method = POST action="index.php" >
密碼修改成功!
<br>
<div class="btn_right"><input type="submit" name = "next" value = "回到選單"></div>
</form>
</div>
</div>
